<div class="SipeiInfo border_3 pb20 centered back_bgf">
	<?php
	$form = $this->beginWidget('CActiveForm', array(
	'action' => Yii::app()->createUrl('/subject/default/update_question'),
	'method' => 'POST',
	'id' => 'searchForm',
	'htmlOptions'=>array('target'=>'ajax-frame')));
	?>
	<table width="480" class="fontc_666 height32">
		<tbody>
			<tr>
                            <td width="114" align="right" class="pt20 pr2 pb20">科目名称：</td>
                            <td width="364" class="pt20 pb20">
                                <?php echo $subject_data->subject_name; ?>
                            </td>
			</tr>
			<tr height="55">
                            <td valign="top" align="right" class="pr2"><span class="pr5 fontc_orange_red">*</span>题型代码：</td>
                            <td valign="top" class="formValidator_td">
                                <input type="text" name="info[question_code]" value="<?php echo $question_data['question_code']; ?>" class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666" id='question_code' />
                                <div class="formValidator_tip">
                                    <p id="question_codeTip" ></p>
                                </div>
                            </td>
			</tr>
			<tr height="55">
                            <td valign="top" align="right" class="pr2"><span class="pr5 fontc_orange_red">*</span>题型名称：</td>
                            <td class="formValidator_td">
                                <input type="text" name="info[question_name]" value="<?php echo $question_data['question_name']; ?>" class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666" id='question_name'/>
                                <div class="formValidator_tip">
                                    <p id="question_nameTip" ></p>
                                </div>
                            </td>
			</tr>
			<tr>
                            <td align="right" class="pr2">是否生效：</td>
                            <td><input type="checkbox" name="info[disabled]" value='1'  <?php if ($question_data['disabled'] == '1')echo 'checked';?> /></td>
			</tr>
			<tr>
                            <td align="right" class="pt10 pr2">是否人工阅卷：</td>
                            <td class="pt10"><input type="checkbox" name="info[aritificial]" value='1' <?php if ($question_data['aritificial'] == '1')echo 'checked';?> /></td>
			</tr>
			<tr>
                            <td align="right" valign="top" class="pt20 pr2">备注：</td>
                            <td class="pt20"><textarea class="col3 pt6 pr10 pb6 pl10 border_c border_3 fontc_666" name="info[description]" ><?php echo (!empty($question_data['description'])) ? $question_data['description'] : ''; ?></textarea></td>
			</tr>
			<tr>
                            <td align="right" class="pt20 pr2 pb20"></td>
                            <input type="hidden" name="info[subject_id]" value="<?php echo $question_data['subject_id']; ?>">
                            <input type="hidden" name="info[question_id]" value="<?php echo $question_data['question_id']; ?>">
                            <td class="pt20 pb20">					
                                <input type="submit" value="保存" name="submit" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 cursor mr10" />
                                <input type="button" value="取消" onclick="api.close()" class="b_a_n border_3 back_bgb w80 height32 fontc_FFF fonts_12 cursor" />
                            </td>
			</tr>
		</tbody>
	</table>
	<?php
	$this->endWidget();
	?>
</div>
<iframe src='' style="display:none" name='ajax-frame'></iframe>
<script>
$(function(){
	$.formValidator.initConfig({formID:"searchForm",theme:"126",submitOnce:false,
	onError:function(msg,obj,errorlist){
		$("#errorlist").empty();
		$.map(errorlist,function(msg){
			$("#errorlist").append("<li>" + msg + "</li>")
		});
		alert(msg);
	},
	ajaxPrompt : '有数据正在异步验证，请稍等...'
	});

	/*科目代码验证*/
	$("#question_code").formValidator({
		onShowText:"请输入题型代码",
		onShow:"",
		onFocus:"",
		onCorrect:"输入正确",
		leftTrim:true,
		rightTrim:true
	}).inputValidator({
		min:1,
		max:20,
		onError:"题型代码长度在1-20之间"
	}).regexValidator({
		regExp:"^[a-zA-Z]{1,}([0-9]|[a-zA-Z])+$",
		onError:"题型代码格式不正确"
	});
	/*科目名称验证*/
	$("#question_name").formValidator({
		onShowText:"请输入题型名称",
		onShow:"",
		onFocus:"",
		onCorrect:"输入正确",
		leftTrim:true,
		rightTrim:true
	}).inputValidator({
		min:1,
		max:20,
		onError:"题型名称应在1-20之间(1到10个汉字)"
	});

})
</script>
<?php exit; ?>
